#pragma once
#include "Hash.hpp"

namespace lw
{
	template<class K, class Hash = Hash<K>, class Equal = Equal<K>>
	class unordered_set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename HashBucket<K, const K, SetKeyOfT, Hash, Equal>::iterator iterator;
		unordered_set()
		{}
		~unordered_set()
		{}
		iterator begin()
		{
			return _hs.begin();
		}
		iterator end()
		{
			return _hs.end();
		}
		std::pair<iterator, bool> insert(const K& key)
		{
			return _hs.Insert(key);
		}
		bool erase(const K& key)
		{
			return _hs.Erase(key);
		}
		iterator find(const K& key)
		{
			return _hs.Find(key);
		}
	private:
		HashBucket<K, const K, SetKeyOfT, Hash, Equal> _hs;
	};
}